From: emellor@ewan Date: Mon, 3 Oct 2005 23:30:49 +0000 (+0100) Subject: Remove the reason parameter from XendDomain.destroy -- it is useless. Accept X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16763^2~56^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0b630dbfcac8efea89f2fd7a9a53bfdbf8d6f4ba;p=xen.git Remove the reason parameter from XendDomain.destroy -- it is useless. Accept the halt shutdown reason inside XendDomainInfo. This indicates that the domain should be shutdown just like a poweroff, except that the domain is not restarted, regardless of the on_poweroff configuration setting. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 81302ad031..9e13e8735e 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -316,16 +316,10 @@ class XendDomain: raise XendError(str(ex)) - def domain_shutdown(self, domid, reason='poweroff'): + def domain_shutdown(self, domid, reason = 'poweroff'): """Shutdown domain (nicely). - - poweroff: restart according to exit code and restart mode - - reboot: restart on exit - - halt: do not restart - Returns immediately. - - @param id: domain id - @param reason: shutdown type: poweroff, reboot, suspend, halt + @param reason: shutdown reason: poweroff, reboot, suspend, halt """ self.callInfo(domid, XendDomainInfo.shutdown, reason) @@ -335,13 +329,8 @@ class XendDomain: return self.callInfo(domid, XendDomainInfo.send_sysrq, key) - def domain_destroy(self, domid, reason='halt'): - """Terminate domain immediately. - - halt: cancel any restart for the domain - - reboot schedule a restart for the domain - - @param domid: domain id - """ + def domain_destroy(self, domid): + """Terminate domain immediately.""" if domid == PRIV_DOMAIN: raise XendError("Cannot destroy privileged domain %i" % domid) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 5a4d145a6f..7a479aa698 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -59,12 +59,16 @@ DOMAIN_SUSPEND = 2 """Shutdown code for crash.""" DOMAIN_CRASH = 3 +"""Shutdown code for halt.""" +DOMAIN_HALT = 4 + """Map shutdown codes to strings.""" shutdown_reasons = { DOMAIN_POWEROFF: "poweroff", DOMAIN_REBOOT : "reboot", DOMAIN_SUSPEND : "suspend", DOMAIN_CRASH : "crash", + DOMAIN_HALT : "halt" } restart_modes = [